MSM delegation by Benny Pinkas


ZKP Seminar — Luca Dall’Ava, 1st of December 2025


Aim: Present a delegation protocol recently devised (posted on February 14, 2025) by Benny Pinkas in [P25].


Introduction and preliminary considerations

There are several protocols suited for delegation of heavy computations like TIPP\text{TIPP} and MIPP\text{MIPP} in [BMMTV19] and improved versions in [CGGJMT23]: these protocols are used in Bulletproofs [BBBPWM17]. However, these rely on a trusted party or on expensive verification (see [J24] for example), while the protocol proposed by in [P25] explicitly work with an untrusted party.

Let F\mathbb{F} be a finite field and let G\mathbb{G} be the group of F\mathbb{F}-rational points of an elliptic curve E\mathcal{E} defined over F\mathbb{F}.

Notation: We follow [P25] and write G\mathbb{G} with multiplicative notation.

Aim of the protocol:

Given public v=(v1,,vn)Gn\mathbf{v}=(v_1,\ldots, v_n)\in\mathbb{G}^n and d=(d1,,dn)Fn\mathbf{d}=(d_1,\ldots, d_n)\in\mathbb{F}^n:

  • an untrusted prover computes the Multi-Scalar Multiplication (MSM)
    vd:=i=1nvidi,\mathbf{v}^\mathbf{d}:=\prod_{i=1}^{n}v_i^{d_i},

    and

  • a verifier verifies that the quantity vd\mathbf{v}^\mathbf{d} computed and provided by the prover is performed correctly, without computing the whole MSM.

Remark and Notation:

  • We can assume that the exponents (d1,,dn)FnZn(d_1,\ldots, d_n)\in\mathbb{F}^n\cap \mathbb{Z}^n.
  • We denote by mm the bit-length of the exponents did_i; we can assume that these are picked uniformly at random in F\mathbb{F} and consider m=log2(F)m=\lceil\log_2(|\mathbb{F}|)\rceil.

The main algebraic manipulations behind the protocols are:

  • the binary expansion of each did_i:
    di=di,0+2di,1++2m1di,m1.d_i=d_{i,0}+2\cdot d_{i,1}+\ldots+2^{m-1}\cdot d_{i,m-1}.
  • and the manipulation:
    vd=i=1nvidi=i=1nvij=0m12jdi,j=i=1nj=0m1vi2jdi,j=j=0m1i=1nvi2jdi,j=j=0m1(i=1nvidi,j)2j.\mathbf{v}^\mathbf{d}=\prod_{i=1}^{n}v_i^{d_i}=\prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}2^jd_{i,j}}=\prod_{i=1}^{n}\prod_{j=0}^{m-1}v_i^{2^jd_{i,j}}\\ =\prod_{j=0}^{m-1}\prod_{i=1}^{n}v_i^{2^jd_{i,j}}=\prod_{j=0}^{m-1}\left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{2^j}.

That is, we collect products in buckets depending on the corresponding power of 22.

Therefore, we end up with mm values wjw_j, j=0,,m1j=0,\ldots, m-1:

w0=i=1nvidi,0,,wm1=i=1nvidi,m1.w_0=\prod_{i=1}^{n}v_i^{d_{i,0}},\ldots, w_{m-1}=\prod_{i=1}^{n}v_i^{d_{i,m-1}}.

Thus, the MSM can be written as

vd=j=0m1wj2j.\mathbf{v}^\mathbf{d}=\prod_{j=0}^{m-1}w_j^{2^j}.

Remark:

  • Recall that each di,j{0,1}d_{i,j}\in\{0,1\}, therefore we have MSMs with trivial scalars.
  • Provided the wjw_j’s, we can compute vd\mathbf{v}^\mathbf{d} with mm multiplications and mm squarings as
    j=0m1wj2j=w0(w1(w2(wm2wm12)2)2)2;\prod_{j=0}^{m−1}w_j^{2^j}=w_0\cdot (w_1\cdot ( w_2\cdots(w_{m-2}\cdot w_{m-1}^{2})^2\cdots )^2)^2;

    Note that this resembles Horner’s method for evaluating a polynomial (https://en.wikipedia.org/wiki/Horner%27s_method):

    a0+a1x+a2x2+a3x3++anxn=a0+x(a1+x(a2+x(a3++x(an1+xan)))). a_0+a_1x+a_2x^2+a_3x^3+\cdots +a_nx^n \\ =a_0+x(a_1+x(a_2+x(a_3+\cdots+x(a_{n−1}+xa_n)))).

Cryptographic Assumptions

Notation: Let λ\lambda be a security parameter.

Assumption 0:

We assume λ<mn\lambda<m\ll n.

The protocol is based on two main assumptions, a first one, due to cryptographic reasons, while the second one for performance improvements.

Assumption 1:

A crucial assumption in [P25] is that the group G\mathbb{G} has an order that does not have small factors.

  • Mathematically, we want that the order of each (non-unit) element is big enough, that is, at least 2λ2^\lambda.
  • An example (which is perfect for the Tokamak Network ZKP) is that of the group associated with the elliptic curve BLS12-381 [B17] which has prime order.

Assumption 2:

We assume that the multi-exponentiation uses exponents that are uniformly distributed, or at least that the expected value of the exponent is close to the order of the group.

This assumption is not relevant for the protocol per se, but it is crucial for the performance improvements.

The Protocol

As stated above, the aim of the protocol is

  • for a Prover to convince that it computed correctly the MSM vd\mathbf{v}^\mathbf{d} and
  • for a Verifier to verify the Prover’s statement without computing the whole MSM.

The second step is the crux in the wholes scheme, as we are working under a third hypothesis.

Assumption 3:

The party working as the Prover is not-trusted.

We can now present the protocol and discuss its security proofs.

Protocol: Delegated Partial MSM — ΠMSM\Pi_{MSM}


Prover P\mathsf{P} and Verifier V\mathsf{V} input:

  • public v=(v1,,vn)Gn\mathbf{v}=(v_1,\ldots, v_n)\in\mathbb{G}^n;
  • public d=(d1,,dn)Fn\mathbf{d}=(d_1,\ldots, d_n)\in\mathbb{F}^n.

Output:

  • Purported MSM partial values wjw_j,
  • True\mathsf{True} or False\mathsf{False}, representing the authenticity of (all) the equalities wj=i=1nvidi,jw_{j}=\prod_{i=1}^{n}v_i^{d_{i,j}}.


  1. P\mathsf{P} computes, for each i=1,,ni=1,\ldots,n:
    di=di,0+2di,1++2m1di,m1.d_i=d_{i,0}+2\cdot d_{i,1}+\ldots+2^{m-1}\cdot d_{i,m-1}.
  1. P\mathsf{P} computes, for each j=1,,mj=1,\ldots,m:
    wj=i=1nvidi,j.w_{j}=\prod_{i=1}^{n}v_i^{d_{i,j}}.
  1. P\mathsf{P} sends V\mathsf{V} the values wj,j=0,,m1w_{j},\, j=0,\ldots,m-1.
  1. V\mathsf{V} chooses mm random coefficients r0,,rm1{0,1}m×λr_0,\ldots,r_{m-1}\in\{0,1\}^{m\times \lambda} (that is, mm number of λ\lambda-bits).
  1. V\mathsf{V} computes the length-mm MSM with exponents of λ\lambda bits:
    w:=j=0m1wjrj.w' := \prod_{j=0}^{m−1}w_j^{r_j}.
  1. V\mathsf{V} computes the length-nn MSM with exponents of λ+log2m\lambda+\log_2m bits:
    w:=i=1nvij=0m1rjdi,j.w'' := \prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}r_j\cdot d_{i,j}}.
  1. V\mathsf{V} checks
    w=w,w'=w'',

    and if the equality holds, returns True\mathsf{True}. Otherwise, it returns False\mathsf{False}.

Once protocol ΠMSM\Pi_{MSM} has been performed, the verifier is convinced (with probability at least 12λ1-2^{-\lambda}; see Lemma ) that the MSMs wjw_j have been correctly computed.

Therefore, the verifier V\mathsf{V} can compute

j=0m1wj2j=w0(w1(w2(wm2wm12)2)2)2.\prod_{j=0}^{m−1}w_j^{2^j}=w_0\cdot (w_1\cdot ( w_2\cdots(w_{m-2}\cdot w_{m-1}^{2})^2\cdots )^2)^2.

Proposition (Completeness):

The protocol ΠMSM\Pi_{MSM} is complete.

  • Proof:

    It is enough to notice (again) that

    vd=i=1nvidi=i=1nvij=0m12jdi,j=i=1nj=0m1vi2jdi,j=j=0m1i=1nvi2jdi,j=j=0m1(i=1nvidi,j)2j=j=0m1wj2j.\mathbf{v}^\mathbf{d}=\prod_{i=1}^{n}v_i^{d_i}=\prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}2^jd_{i,j}}=\prod_{i=1}^{n}\prod_{j=0}^{m-1}v_i^{2^jd_{i,j}} =\prod_{j=0}^{m-1}\prod_{i=1}^{n}v_i^{2^jd_{i,j}}=\prod_{j=0}^{m-1}\left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{2^j} =\prod_{j=0}^{m-1}w_j^{2^j}.

    \blacksquare

Lemma:

Given a group (G,1,)(\mathbb{G},1,\cdot), what is the probability that a product of mm, uniformly picked at random group elements is the unit 11? It is

Pr[j=0m1gj=1|gj$G]1G.\Pr\left[\,\prod_{j=0}^{m-1}g_j = 1 \,\middle|\, g_j\gets_{\$} \mathbb{G}\, \right] \leq \frac{1}{|\mathbb{G}|}.
  • Proof:

    We proceed on induction on mm.

    • If m=1m=1, the claim is trivial and equality holds.
    • Similarly, for m=2m=2, the claim is obtained from the fact that there exists a unique inverse for each group element. Equality holds.
    • Let us assume the claim for m1m-1 and prove it for mm.

      Now, the probability, by Bayes’ Theorem, is

      Pr[j=0m1gj=1|gj$G]Pr[g0G=1G=j=1m1gj|gj$G]=Pr[g0G=1|gj$GG=j=1m1gj]Pr[G=j=1m1gj|gj$G]=Pr[g0G=1|g0,G$G]Pr[G=j=1m1gj|gj$G]1G1.\Pr\left[\,\prod_{j=0}^{m-1}g_j = 1 \,\middle|\, g_j\gets_{\$} \mathbb{G}\, \right] \leq \Pr\left[\,g_0\cdot G = 1 \,\land\, G = \prod_{j=1}^{m-1}g_j\,\middle|\, g_j\gets_{\$} \mathbb{G}\,\right] = \Pr\left[\,g_0\cdot G = 1 \,\middle|\, g_j\gets_{\$} \mathbb{G}\,\land\, G = \prod_{j=1}^{m-1}g_j\,\right]\cdot \Pr\left[\,G = \prod_{j=1}^{m-1}g_j\,\middle|\, g_j\gets_{\$} \mathbb{G}\,\right] = \Pr\left[\,g_0\cdot G = 1 \,\middle|\, g_0,G\gets_{\$} \mathbb{G}\,\right]\cdot \Pr\left[\,G = \prod_{j=1}^{m-1}g_j\,\middle|\, g_j\gets_{\$} \mathbb{G}\,\right] \leq \frac{1}{|\mathbb{G}|}\cdot 1.

      \blacksquare

Lemma:

In the protocol ΠMSM\Pi_{MSM}, provided that the random values r0,,rm1r_0,\ldots,r_{m-1} are independent, the probability that the quantities ww' and ww'' are equal given that not all wiw_i values are computed correctly is

Pr[w=w|j{0,,m1}:wji=1nvidi,j]2λ.\Pr\left[\, w'=w''\, \middle|\, \exists\, j\in\{0,\ldots,m-1\}:w_j\neq \prod_{i=1}^{n}v_i^{d_{i,j}}\,\right]\leq 2^{-\lambda}.
  • Proof:

    We can write

    w=i=1nvij=0m1rjdi,j=i=1nj=0m1virjdi,j=j=0m1i=1nvirjdi,j=j=0m1(i=1nvidi,j)rj,w''=\prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}r_j\cdot d_{i,j}}=\prod_{i=1}^{n}\prod_{j=0}^{m-1}v_i^{r_j\cdot d_{i,j}} =\prod_{j=0}^{m-1}\prod_{i=1}^{n}v_i^{r_j\cdot d_{i,j}}=\prod_{j=0}^{m-1}\left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{r_j},

    and compare it with w=j=0m1wjrjw'=\prod_{j=0}^{m-1}w_j^{r_j}.

    Now, suppose that there exists a jj such that wji=1nvidi,jw_j\neq \prod_{i=1}^{n}v_i^{d_{i,j}}; WLOG we can fix j=0j=0. Since G\mathbb{G} is a group we can write:

    w=w    1=w(w)1=j=0m1(wj(i=1nvidi,j)1)rj    1=(w0(i=1nvidi,0)1)r0j=1m1(wj(i=1nvidi,j)1)rjG.w'=w'' \iff 1=w'\cdot (w'')^{-1} = \prod_{j=0}^{m-1}\left(w_j\cdot\left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{-1}\right)^{r_j}\\ \iff 1 = \left(w_0\cdot\left(\prod_{i=1}^{n}v_i^{d_{i,0}}\right)^{-1} \right)^{r_0} \cdot \prod_{j=1}^{m-1}\left(w_j\cdot \left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{-1}\right)^{ r_j} \in \mathbb{G}.

    Therefore, written gj:=(wj(i=1nvidi,j)1)rjGg_j:=\left(w_j\cdot \left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{-1}\right)^{ r_j} \in \mathbb{G}, we can apply the above Lemma , since

    • g0rj=wj(i=1nvidi,j)11g_0^{-r_j}= w_j\cdot \left(\prod_{i=1}^{n}v_i^{d_{i,j}}\right)^{-1}\neq 1, by hypothesis, and therefore, its (unique) inverse is non-trivial;
    • we can assume that the gjg_j are independent since the rjr_j are;
    • since the group has order without small factors as in (one can consider prime order) and the exponents have at most λ<m\lambda<m bits, g01g_0\neq 1 (and therefore, its unique inverse is non-trivial).

    Therefore we have

    Pr[w=w|j{0,,m1}:wji=1nvidi,j]Pr[j=0m1gj=1gj$G]1G=2m2λ.\Pr\left[\, w'=w''\, \middle|\, \exists\, j\in\{0,\ldots,m-1\}:w_j\neq \prod_{i=1}^{n}v_i^{d_{i,j}}\,\right]\leq \Pr\left[\prod_{j=0}^{m-1}g_j = 1 | g_j\gets_{\$} \mathbb{G} \right] \leq \frac{1}{|\mathbb{G}|}= 2^{-m}\leq 2^{-\lambda}.

    \blacksquare

Proposition:

The protocol ΠMSM\Pi_{MSM} is sound.

  • Proof:

    The soundness is proved by the above Lemma, with soundness error 2λ2^{-\lambda}.

    \blacksquare

Drawbacks of the protocol

This protocol makes sure to work with an untrusted prover, however, it has its own drawbacks.

On the randomness and the security parameter

It is important to notice that, in the security proof, we make a strong use of the assumption

The selected random exponents r0,,rm1r_0,\ldots,r_{m−1} are independent and provided by the verifier.

Pinkas warns, as one should be aware of, that applying the Fiat—Shamir transform:

  • the security proofs are, strictly speaking, no more valid,
  • in this setting, λ\lambda should be picked to be, at least, λ=128\lambda=128.
When the Fiat-Shamir proof paradigm is used, a prover can mount a brute-force search for a challenge, namely a set of rir_i exponents that makes the proof pass. Therefore, the analysis given here does not hold when the exponents are chosen by the prover using the Fiat-Shamir paradigm. (In that case, the security parameter λλ should be set to be at least λ=128λ=128.) The correct procedure involves the verifier selecting the random exponents r0,,rm1r_0,\ldots,r_{m−1} and executing the computations using these values.

Some other references about the delicate topic of the Fiat-Shamir transform and some attacks:

Overhead in the protocol

The protocol’s Verifier V\mathsf{V} incurs in some overhead consisting of:

  • mm calls to a random oracle box r0,,rm1{0,1}m×λr_0,\ldots,r_{m-1}\in\{0,1\}^{m\times \lambda} (that is, mm number of λ\lambda-bits); producing hashes is expensive on the Ethereum L1.
  • 11 length-mm MSM with exponents of λ\lambda bits: w:=j=0m1wjrjw' := \prod_{j=0}^{m−1}w_j^{r_j}; minor, mnm\ll n.
  • 11 length-nn MSM with exponents of λ+log2(m)\lambda+\log_2(m) bits: w:=i=1nvij=0m1rjdi,jw'' := \prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}r_j\cdot d_{i,j}}; main overhead.

Then the verifier can compute:

  • 11 final MSM computed as j=0m1wj2j=w0(w1(w2(wm2wm12)2)2)2\prod_{j=0}^{m−1}w_j^{2^j}=w_0\cdot (w_1\cdot ( w_2\cdots(w_{m-2}\cdot w_{m-1}^{2})^2\cdots )^2)^2 (consisting of mm squarings and mm multiplications (circa 2m22m-2 R1CS equations)).

Let us quote:

Since the overhead of the multi-exponentiation is linear in the length of the exponents, performance is roughly improved by a factor of m/(λ+log2(m))m/(\lambda+\log_2(m)).

Remark (Question):

In terms of R1CS constraints, is a length-nn MSM with exponents of λ+log2(m)\lambda+\log_2(m) bits cheaper than a length-nn MSM with exponents of mm bits if λ+log2(m)<m\lambda+\log_2(m) < m.

Some numerical considerations

The protocol provides some gains only when mnm\ll n. In the Tokamak ZKP Channel, we have:

  • nn can be taken big enough, a long as the security proof hold true (n=Nn=N in), e.g. 1000,4000\simeq 1000,4000, etc..
  • m255m\simeq 255 (since the BLS12-381 group has prime order with 255255 bits)
  • λm\lambda\leq m.

Pinkas computes,

  • on a MacBook Pro M1,
  • based on the above numbers, and
  • considering the Pippinger Algorithm implemented in Rust by Zhoujun Ma here,

the runtime, in milliseconds (the median of 100 runs) of the computation of the length-nn MSM with exponents of 16,32,64,128,25616, 32,64,128,\textcolor{red}{256}-bits over the BLS12-381 curve.

nn / exp length163264128256
10001.923.566.7413.3225.95
20003.066.1912.3624.6248.28
40005.7612.1122.4843.1583.53
800010.9322.4741.8082.57162.81

Then, he computes, for

  • λ=40,64\lambda=40, 64,
  • the runtime (in milliseconds, the median of 64 runs), and the gains,
  • for the exponent lengths of λ+log2m=λ+8\lambda+\log_2m = \lambda + 8,

of the value w:=i=1nvij=0m1rjdi,jw'' := \prod_{i=1}^{n}v_i^{\sum_{j=0}^{m-1}r_j\cdot d_{i,j}} and compare it with the whole MSM vd\mathbf{v}^\mathbf{d}.

nλ=40, exp len = 48, runtimeλ=40, exp len = 48, gainλ=64, exp len = 72, runtimeλ=64, exp len = 72, gainexp len = 255, runtime
1,0004.725.367.33.4625.28
4,00015.95.0022.43.5579.49
16,00051.665.5381.383.51285.85
64,000173.435.43259.033.64942.09
256,000676.14.79989.053.283241.4
1,024,0002321.25.253702.43.2912192
Ideal gain5.313.54

Questions to be investigated

We are left with a few questions that we wish to answer:

  1. Can we verify multiple MSMs at the same time?
    1. I believe so, but we need to introduce further random values.
  1. How efficient is this approach for verification on a Layer 1 blockchain like Ethereum?
  1. Can the protocol be further improved?

Further application issues

  • Ethereum has some precompiled contracts handling BLS12-381 MSMs: https://www.evm.codes/precompiled. Unfortunately, they do not depend on the bit-length of the exponents, thus, making handling smaller length exponents a too small improvement.

References:

  • [BBBPWM17] - Benedikt Bünz and Jonathan Bootle and Dan Boneh and Andrew Poelstra and Pieter Wuille and Greg Maxwell, Bulletproofs: Short Proofs for Confidential Transactions and More, Cryptology ePrint Archive, Paper 2017/1066, 2017, https://eprint.iacr.org/2017/1066
  • [BMMTV19] - Benedikt Bünz, Mary Maller, Pratyush Mishra, Nirvan Tyagi, and Psi Vesely, “Proofs for Inner Pairing Products and Applications”, Cryptology ePrint Archive, 2019, https://eprint.iacr.org/2019/1177
  • [CGGJMT23] - Campanelli, M., Gailly, N., Gennaro, R., Jovanovic, P., Mihali, M., & Thaler, J. (2023). Testudo: Linear Time Prover SNARKs with Constant Size Proofs and Square Root Size Universal Setup. IACR Cryptology ePrint Archive, Report No. 2023/961, https://eprint.iacr.org/2023/961

Inline comments

Block text: Let F\mathbb{F} be a finite field and let G\mathbb{G} be the group of F\mathbb{F}-rational points of an elliptic curve E\mathcal{E} defined over F\mathbb{F}.

  • Luca Dall'Ava
    The setting can be generalized to any module M\mathbb{M} over a ring A\mathbb{A} (without zero-divisors) I believe.

Block text: V\mathsf{V} chooses mm random coefficients r0,,rm1{0,1}m×λr_0,\ldots,r_{m-1}\in\{0,1\}^{m\times \lambda}.

  • Luca Dall'Ava
    We can actually make it non-interactive and delegate this hash computation to the Prover, but with higher λ\lambda!
  • Luca Dall'Ava
    Note that they MUST be independently picked.

Block text: computes the length-nn MSM

  • Luca Dall'Ava
    Main Overhead